package com.xuwang.service.impl;

import com.github.pagehelper.PageHelper;
import com.xuwang.dto.RawMaterialEarlyWarningDto;
import com.xuwang.mapper.RawMaterialSupplierGMapper;
import com.xuwang.service.RawMaterialSupplierServiceG;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class RawMaterialSupplierServiceGImpl implements RawMaterialSupplierServiceG {

    @Resource
    private RawMaterialSupplierGMapper rawMaterialSupplierGMapper;
    @Override
    public Map<String, Object> earlyWarning( int page, int limit) {
        Map<String, Object> map = new HashMap<>();
        PageHelper.startPage(page, limit);
        List<RawMaterialEarlyWarningDto> rawMaterialSupplier = this.rawMaterialSupplierGMapper.selectRawMaterialWarranty();
        System.out.println(rawMaterialSupplier);
        map.put("code", 200);
        map.put("data", rawMaterialSupplier);
        map.put("count", rawMaterialSupplier.size());
        return map;
    }
}

